import React, {Component, PropTypes} from 'react';
import classNames from 'classnames';
/**
 * 工具栏组件
 */
export default class Toolbar extends Component{

	static propTypes = {
		align: PropTypes.oneOf(['left', 'center', 'right']),
		bordered: PropTypes.bool
	}

	static defaultProps = {
		align: 'left',
		bordered: true
	}

	render(){
		let {bordered, align} = this.props;
		let cls = classNames({
			'rd-toolbar': true,
			'rd-toolbar-bordered': bordered,
			['rd-toolbar-' + align]: align && align != 'left'
		});
		return (
			<div className={cls}>
				{this.props.children}
			</div>
		)
	}
}